package cn.edu.stu.syllabus.repository.oa;

import java.util.List;

import javax.inject.Inject;

import cn.edu.stu.syllabus.repository.oa.local.OaInfoEntry;
import cn.edu.stu.syllabus.di.qualifier.Local;
import cn.edu.stu.syllabus.di.scope.FragmentScoped;
import rx.Observable;

/**
 * Created by daidaijie on 2017/3/14.
 */

@FragmentScoped
public class OaStarDataRepository implements OaStarDataSource {

    OaStarDataSource mOaStarLocalDataSource;

    @Inject
    public OaStarDataRepository(@Local OaStarDataSource oaStarLocalDataSource) {
        mOaStarLocalDataSource = oaStarLocalDataSource;
    }

    @Override
    public void starOaInfoEntry(OaInfoEntry oaInfoEntry) {
        mOaStarLocalDataSource.starOaInfoEntry(oaInfoEntry);
    }

    @Override
    public void unstarOaInfoEntry(OaInfoEntry oaInfoEntry) {
        mOaStarLocalDataSource.unstarOaInfoEntry(oaInfoEntry);
    }

    @Override
    public boolean isExistEntry(OaInfoEntry oaInfoEntry) {
        return mOaStarLocalDataSource.isExistEntry(oaInfoEntry);
    }

    @Override
    public Observable<List<OaInfoEntry>> getStarOaInfoEntries(long lastPosition, int pageNum) {
        return mOaStarLocalDataSource.getStarOaInfoEntries(lastPosition, pageNum);
    }

}
